﻿using WMS.FC.Domain.DomainObject.System;

namespace WMS.FC.Domain.PersistenceObject.History
{
    /// <summary>
    /// 任务履历
    /// </summary>
    [SplitTable(TableName = "HIS_TASK", TableDescription = "任务履历")]
    [SplitTableIndex("1", nameof(CreateDate), nameof(Code), false)]
    [SplitTableIndex("2", nameof(CreateDate), nameof(TypeCode), false)]
    [SplitTableIndex("3", nameof(CreateDate), nameof(ZoneCode), false)]
    [SplitTableIndex("4", nameof(CreateDate), nameof(LineCode), false)]
    [SplitTableIndex("5", nameof(CreateDate), nameof(EquipmentCode), false)]
    [SplitTableIndex("6", nameof(CreateDate), nameof(StateCode), false)]
    [SplitTableIndex("7", nameof(CreateDate), nameof(StartPointTypeCode), false)]
    [SplitTableIndex("8", nameof(CreateDate), nameof(EndPointTypeCode), false)]
    [SplitTableIndex("9", nameof(CreateDate), nameof(TrayBarcode1), false)]
    [SplitTableIndex("10", nameof(CreateDate), nameof(TechnologyRouteCode), false)]
    [SplitTableIndex("11", nameof(CreateDate), nameof(TechnologyProcessCode), false)]
    [SplitTableIndex("12", nameof(CreateDate), nameof(StartTime), false)]
    [SplitTableIndex("13", nameof(CreateDate), nameof(EndTime), false)]
    [SplitTableIndex("SEARCH", nameof(CreateDate), nameof(Code), nameof(TypeCode), nameof(ZoneCode), nameof(LineCode), nameof(EquipmentCode), nameof(StateCode), nameof(StartPointTypeCode), nameof(EndPointTypeCode), nameof(TrayBarcode1), nameof(TechnologyRouteCode), nameof(TechnologyProcessCode), nameof(StartTime), nameof(EndTime), false)]
    public class HisTaskPO : HistoryPOBase
    {
        /// <summary>
        /// 编码
        /// </summary>
        [SplitTableColumn(ColumnName = "CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "编码")]
        public string Code { get; set; } = string.Empty;

        /// <summary>
        /// 类型编码
        /// </summary>
        [SplitTableColumn(ColumnName = "TYPE_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "类型编码")]
        public string TypeCode { get; set; } = string.Empty;

        /// <summary>
        /// 区域编码
        /// </summary>
        [SplitTableColumn(ColumnName = "ZONE_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "区域编码")]
        public string ZoneCode { get; set; } = string.Empty;

        /// <summary>
        /// 产线编码
        /// </summary>
        [SplitTableColumn(ColumnName = "LINE_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "产线编码")]
        public new string LineCode { get; set; } = string.Empty;

        /// <summary>
        /// 设备编码
        /// </summary>
        [SplitTableColumn(ColumnName = "EQUIPMENT_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "设备编码")]
        public string EquipmentCode { get; set; } = string.Empty;

        /// <summary>
        /// 状态编码
        /// </summary>
        [SplitTableColumn(ColumnName = "STATE_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "状态编码")]
        public string StateCode { get; set; } = string.Empty;

        /// <summary>
        /// 起点类型编码
        /// </summary>
        [SplitTableColumn(ColumnName = "START_POINT_TYPE_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "起点类型编码")]
        public string StartPointTypeCode { get; set; } = string.Empty;

        /// <summary>
        /// 起点编码
        /// </summary>
        [SplitTableColumn(ColumnName = "START_POINT_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "起点编码")]
        public string StartPointCdoe { get; set; } = string.Empty;

        /// <summary>
        /// 终点类型编码
        /// </summary>
        [SplitTableColumn(ColumnName = "END_POINT_TYPE_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "终点类型编码")]
        public string EndPointTypeCode { get; set; } = string.Empty;

        /// <summary>
        /// 终点编码
        /// </summary>
        [SplitTableColumn(ColumnName = "END_POSINT_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "终点编码")]
        public string EndPointCode { get; set; } = string.Empty;

        /// <summary>
        /// 优先级
        /// </summary>
        [SplitTableColumn(ColumnName = "PRIORITY", ColumnDataType = "NUMBER(10)", ColumnDescription = "优先级")]
        public int Priority { get; set; }

        /// <summary>
        /// 容器条码
        /// </summary>
        [SplitTableColumn(ColumnName = "CONTAINER_BARCODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "容器条码")]
        public string ContainerBarcode { get; set; } = string.Empty;

        /// <summary>
        /// 底层托盘条码
        /// </summary>
        [SplitTableColumn(ColumnName = "TRAY_BARCODE_1", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "底层托盘条码")]
        public string TrayBarcode1 { get; set; } = string.Empty;

        /// <summary>
        /// 中层托盘条码
        /// </summary>
        [SplitTableColumn(ColumnName = "TRAY_BARCODE_2", ColumnDataType = "VARCHAR2(50)", IsNullable = true, ColumnDescription = "中层托盘条码")]
        public string? TrayBarcode2 { get; set; }

        /// <summary>
        /// 上层托盘条码
        /// </summary>
        [SplitTableColumn(ColumnName = "TRAY_BARCODE_3", ColumnDataType = "VARCHAR2(50)", IsNullable = true, ColumnDescription = "上层托盘条码")]
        public string? TrayBarcode3 { get; set; }

        /// <summary>
        /// 托盘组电池数量
        /// </summary>
        [SplitTableColumn(ColumnName = "TOTAL_CELL_COUNT", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "托盘组电池数量")]
        public int TotalCellCount { get; set; }

        /// <summary>
        /// 物料编码
        /// </summary>
        [SplitTableColumn(ColumnName = "MATERIAL_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "物料编码")]
        public string MaterialCode { get; set; } = string.Empty;

        /// <summary>
        /// 工艺路径编码
        /// </summary>
        [SplitTableColumn(ColumnName = "TECHNOLOGY_ROUTE_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "工艺路径编码")]
        public string TechnologyRouteCode { get; set; } = string.Empty;

        /// <summary>
        /// 工艺工序编码
        /// </summary>
        [SplitTableColumn(ColumnName = "TECHNOLOGY_PROCESS_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "工艺工序编码")]
        public string TechnologyProcessCode { get; set; } = string.Empty;

        /// <summary>
        /// 开始时间
        /// </summary>
        [SplitTableColumn(ColumnName = "START_TIME", ColumnDataType = "TIMESTAMP(7)", ColumnDescription = "开始时间")]
        public DateTime StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        [SplitTableColumn(ColumnName = "END_TIME", ColumnDataType = "TIMESTAMP(7)", ColumnDescription = "结束时间")]
        public DateTime EndTime { get; set; }

        /// <summary>
        /// 分配过货位编码
        /// </summary>
        [SplitTableColumn(ColumnName = "USED_LOCATION_CODE", ColumnDataType = "VARCHAR2(2000)", ColumnDescription = "分配过货位编码")]
        public string? UsedLocationCode { get; set; }
    }
}
